package day04;
import com.sun.deploy.panel.SpecialTableRenderer;
import com.sun.xml.internal.stream.buffer.sax.DefaultWithLexicalHandler;
import sun.java2d.pipe.SpanIterator;

import java.util.Scanner;
public class zuoye {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请选择功能：1.取款 2.存款 3.查询余额 0.退卡");
        /*int command=scan.nextInt();
        switch (command){
            case 1:
                System.out.println("取款操作...");
                break;
            case 2:
                System.out.println("存款操作...");
                break;
            case 3:
                System.out.println("余额查询操作...");
                break;
            case 0:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("输入错误");
        }*/



       /* int num=(int) (Math.random()*1000+1);
        System.out.println("猜吧！");
        int guess=scan.nextInt();
        while (guess!=num){
            if (guess>num){
                System.out.println("太大了");
            }else{
                System.out.println("太小了");
            }
            System.out.println("猜吧！");
            guess=scan.nextInt();
        }
        System.out.println("恭喜你猜对了");
        */


        /*int num=(int) (Math.random()*1000+1);
        int guess;
        do{
            System.out.println("猜吧！");
            guess=scan.nextInt();
            if (guess>num) {
                System.out.println("太大了");
            }else if (guess<num){
                System.out.println("太小了");
            }else{
                System.out.println("恭喜你才对了");
            }

        }while (guess!=num);
         */

        /*for (int times=0;times<5;times++){
            System.out.println("行动是成功的阶梯");
        }
        System.out.println("继续执行");

        for (int num=1;num<=9;num++){
            System.out.println(num+"*9="+num*9);
        }

        for (int num=1;num<=9;num+=2){
            System.out.println(num+"*9="+num*9);
        }

        for (int num=9;num<=1;num--){
            System.out.println(num+"*9="+num*9);
        }*/


        /*int a=scan.nextInt();
        switch (a){
            case 1:
                System.out.println("取款操作...");
                break;
            case 2:
                System.out.println("存款操作...");
                break;
            case 3:
                System.out.println("余额查询操作...");
                break;
            case 0:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("输入错误");
        }*/

        /* int b=(int) (Math.random()*1000+1);
        System.out.println("猜吧！");
        int c=scan.nextInt();
        while (c!=b){
            if (c>b){
                System.out.println("太大了");
            }else{
                System.out.println("太小了");
            }
            System.out.println("猜吧！");
           c=scan.nextInt();
        }
        System.out.println("恭喜你猜对了");
        */


        /*int d=(int) (Math.random()*1000+1);
        int e;
        do{
            System.out.println("猜吧！");
            e=scan.nextInt();
            if (e>d) {
                System.out.println("太大了");
            }else if (e<d){
                System.out.println("太小了");
            }else{
                System.out.println("恭喜你才对了");
            }

        }while (e!=d);
         */

        /*for (int h=0;h<5;h++){
            System.out.println("行动是成功的阶梯");
        }
        System.out.println("继续执行");

        for (int f=1;f<=9;f++){
            System.out.println(f+"*9="+f*9);
        }

        for (int g=1;g<=9;g+=2){
            System.out.println(g+"*9="+g*9);
        }

        for (int z=9;z<=1;z--){
            System.out.println(z+"*9="+z*9);
        }*/

        /*System.out.println("请输入一个整数");
        int num=scan.nextInt();
        if (num>0){
            System.out.println("+");
        }else if (num<0){
            System.out.println("-");
        }else{
            System.out.println("0");
        }
         */

        System.out.println("请输入年份：");
        int year=scan.nextInt();
        System.out.println("请输入月份：");
        int month=scan.nextInt();
        int days=0;
        switch (month){
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                days=31;
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                days=30;
                break;
            case 2:
                if (year%4==0&&year%100!=0||year%400==0){
                    days=29;
                }else{
                    days=28;
                }
                System.out.println(year+"年的"+month+"月共"+days+"天");
        }










    }
}
